package day03_ThreadPool.demo_network_Socket.UDP_demo;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class Seller {
    public static void main(String[] args) throws Exception{
        DatagramSocket datagramSocket= new DatagramSocket(10003);
        byte[] buf= "hello".getBytes();
        InetAddress address= InetAddress.getByName("127.0.0.1");

        DatagramPacket datagramPacket= new DatagramPacket(buf,buf.length,address,10004);

        datagramSocket.send(datagramPacket);
        System.out.println("包裹已发出");
    }
}
